home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ** $VER: Solarize.ieb 1.12, IE Arexx script ** Image Engineer Batch Processing script ** Copyright © by Patrik M Nydensten ** 2/2 1997 Stockholm/Sweden ** ** Apply three types of solarize effects to image. */ options results signal on error parse arg input command input = upper(strip(input)) address 'IMAGEENGINEER' select /* Required batch script commands */ when input = 'INFO' then return get_info() when input = 'CONFIG' then return get_config(command) when input = 'PROCESS' then return process_image(command) otherwise do 'REQUEST' '"Failure in call to batch script!"' '" Quit "' return '<ERROR>' end end exit 0 /* Required "Get_info" procedure ------------------------------------ */ /* S = SECONDARY, A = ALPHA, 1 = Single file, 2 = Multiple files */ get_info: back = 'OK' return back /* Required "Get_config" procedure ---------------------------------- */ get_config: parse arg '"'command'"' 'IE_TO_FRONT' if command = '' then do 'FORM "Solarize" " OK | Cancel "', ' RADIO,"Type","Standard|Pg standard|Pg inverse",0' parse var result ok CalcType . if ok = 0 then return '<ERROR>' end else do 'REQUEST' '"The Solarize.ieb does not have'd2c(10)'any settings for the last image."' '" OK "' CalcType = 'none' end back = '#'strip(CalcType) return back /* Required "Process_image" procedure ------------------------------- */ process_image: parse arg '"'src_image'"' '"'dst_image'"' '"'options'"' parse var options '#'CalcType . 'OPEN' '"'src_image'"' '24' if (RC ~= 0) then do 'IE_TO_FRONT' 'REQUEST' '"Failed to load image:' d2c(10)||src_image'"' '" OK "' return '<ERROR>' end else LoadImage = result 'NEGATIVE' LoadImage NegImage=RESULT select when CalcType = 0 then do 'MARK' LoadImage 'PRIMARY' 'MARK' NegImage 'SECONDARY' 'COMPOSITE' 0 0 'MAX' OutputImage = Result end when CalcType = 1 then do 'MARK' LoadImage 'SECONDARY' 'MARK' NegImage 'PRIMARY' 'COMPOSITE' 0 0 'DIFFERENCE' DiffImage = Result 'NEGATIVE' DiffImage OutputImage = Result 'CLOSE' DiffImage end when CalcType = 2 then do 'MARK' LoadImage 'SECONDARY' 'MARK' NegImage 'PRIMARY' 'COMPOSITE' 0 0 'DIFFERENCE' OutputImage = Result end otherwise return '<ERROR>' end /* select */ 'CLOSE' LoadImage 'CLOSE' NegImage if getclip('cfg_save_frmt')='' then setclip('cfg_save_frmt','ILBM CmpByteRun1') 'SAVE_DATA' OutputImage '"'dst_image'"' '"'getclip('cfg_save_frmt')'"' if (RC ~= 0) then do 'IE_TO_FRONT' 'REQUEST' '"Failed to save image:' d2c(10)||dst_image'"' '" OK "' return '<ERROR>' end 'CLOSE' OutputImage back = 'OK' return back /* Internal procedures ---------------------------------------------- */ /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' end return '<ERROR>'